
// --数据请求接口封装
import HttpService from '../api/index';
const httpService = new HttpService('');
// --统一调用接口
const getData = async (url: string, param: any) => {
    console.log(param);
    return new Promise((resolve, reject) => {
      try {
        // 假设接口返回的数据类型是 { message: string }
        httpService
          .get<{ param: any }>(url)
          .then((res: any) => {
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      } catch (error) {
        console.error(error);
      }
    });
  };

export default { getData }